Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: copy-instance was not robust enough #905

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

macrologist
Copy link
Contributor

@macrologist macrologist commented Oct 18, 2023

This partially addresses one source of "nondeterminism" in quilc compilation (see #676) that was due to a violation of referential transparency.

Specifically, non destructive compilation was not non-destructive enough: compiling the same parsed-program instance twice produced two different outputs. This was because copy-instance did not copy instances of measurement deeply, resulting in different outputs from compress-qubits, with downstream consequences.

This only addresses #676 in those cases where you are not parsing the same raw text-based source everytime you compile. Or equivalently, when you are not rebuilding your Program object from pyquil every time.

This partially addresses one source of "nondeterminism" in quilc
compilation (see quil-lang#676) that was due to a violation of referential
transparency.

Specifically, non destructive compilation was not non-destructive
enough: compiling the same parsed-program instance twice did not
successfuly copy measurement instances deeply, resulting in different
outputs from compress-qubits, with downstream consequences.
@macrologist
Copy link
Contributor Author

macrologist commented Oct 18, 2023

(oh: I commented out the clifford tests b/c they've been failing for a while now and I wanted to sanity check my change, we might consider this PR, and any other wide-range-effect PRs to be blocked until the clifford modules and tests are loading, building, and passing again --- I think its just a quicklisp issue; waiting on an update.)

@stylewarning
Copy link
Member

what a great find

@stylewarning
Copy link
Member

re-enable clifford tests and we can merge

@macrologist
Copy link
Contributor Author

turns out the cliffort tests are failing b/c the fucntion cl-permutation::iota-vector does not produce values of type cl-permutation::raw-perm. the former is being used to to produce permutation representations passed in to cl-permutation::%make-perm, throwing a type error. Sit tight.

@macrologist
Copy link
Contributor Author

should be good

@stylewarning stylewarning merged commit ac4effe into quil-lang:master Oct 19, 2023
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants